package com.wanxi.dangdang.model.pojo;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.security.core.GrantedAuthority;

import java.util.Date;

/**
 * @author wr
 * @date 20210830
 * @description 权限类
 * @Version 1.0
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
@Builder
@ApiModel(value = "com.wanxi.dangdang.model.pojo.Permission",description = "权限类")
public class Permission implements GrantedAuthority {
    @ApiModelProperty(value = "主键id",example = "唯一主键")
    private Long id;
    @ApiModelProperty(value = "名称")
    private String name;
    @ApiModelProperty(value = "描述")
    private String description;
    @ApiModelProperty(value = "路径")
    private String uri;
    @ApiModelProperty(value = "创建时间")
    private Date createTime;
    @ApiModelProperty(value = "更新时间")
    private Date updateTime;
    @ApiModelProperty(value = "状态：0未删除，1删除")
    private Integer deleteStatus;

    @Override
    public String getAuthority() {
        return this.uri;
    }
}
